﻿namespace ShellNavigator.Client.Utils
{
  #region

  using System;

  using ShellNavigator.Client.Models;

  #endregion

  /// <summary>
  ///     TODO: Update summary.
  /// </summary>
  public static class AppActionExtensions
  {
    #region Public Methods

    /// <summary>
    ///     The to target.
    /// </summary>
    /// <param name = "action">
    ///     The action.
    /// </param>
    /// <returns>
    ///     Returns target.
    /// </returns>
    public static AppTargets ToTarget(this AppActions action)
    {
      switch (action)
      {
        case AppActions.OpenSolution:
          return AppTargets.Solution;
        case AppActions.OpenProject:
          return AppTargets.Project;
        case AppActions.OpenFile:
          return AppTargets.File;
        case AppActions.CopyFile:
          return AppTargets.File;
        case AppActions.CopyProject:
          return AppTargets.Project;
        case AppActions.CopyAssembly:
          return AppTargets.Project;
        case AppActions.CopySolution:
          return AppTargets.Solution;
        default:
          throw new ArgumentOutOfRangeException("action");
      }
    }

    #endregion
  }
}